IsNumeric and NumericText (str) are equivalent functions. However, IsNumeric is preferred in Basic syntax, whereas NumericText is preferred in Crystal syntax.
str is a String value to be tested.
Boolean value (True or False).
IsNumeric returns True if the String argument can be converted to a Number and False otherwise.
If you store numbers (like weight) in a text String object, use IsNumeric to check the value of each record to make sure it is OK to convert using ToNumber or CDbl.
The following examples are applicable to both Basic and Crystal syntax:
Returns FALSE where {file.REFERENCE} = "ABCDEFG".
Returns TRUE where {file.IDNUM} = "12345".
Returns TRUE where {file.IDNUM} = "12345443".
Returns FALSE where {file.IDNUM} = "12345
IsNumeric ({file.IDNUM} (1 to 5))
Returns TRUE where {file.IDNUM} = "12345
Returns FALSE where {file.IDNUM} = "12345
IsNumeric ({file.IDNUM} (7 to 9))
Returns TRUE where {file.IDNUM} = "12345
Returns FALSE where {file.IDNUM} = "12345T".
Note: You can use this function in combination with ToNumber (numeric), ToNumber (string), ToNumber (Boolean) or CStr to test for a Number in the Reference field, then return the string as a Number or return 0 if the text string is not a Number.
The following example is applicable to Basic syntax:
If IsNumeric({file.IDNUM}) Then
formula = ToNumber({file.IDNUM})
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |